<script type="text/javascript">
document.onkeydown=ShowEnterKey;
    if   (event.keyCode==13)   
    {   

        event.keyCode=0;
        event.returnValue   =   false;

    } 
    
}

</script>
<p/><br/>
<div id="user_search_table" onload="document.onkeydown()">
  <% form_tag users_path, :method => 'get' do %>
    <%= text_field_tag :search,params[:search],:size => 50 %><img id="spinner" src="/images/spinner.gif" style="display:none"/>
<!-- <input id="tmp" name="tmp" size="50" type="text" style="display:none;" /> -->
    <%#= submit_tag "search",:name =>nil %>
  <!--  <input type="image" id="submit" name="submit" src="/images/search.gif"/> -->
    <%= observe_field 'search',:url =>{:action =>'search_users'},:method =>'post',:update => 'search_result',
      :frequency => 2,:with =>'search', :before => "Element.show('spinner');",
  :complete => "Element.hide('spinner');"%>
  <% end %>
  <span style="font-size:11px">输入员工号,姓名,姓名首字母,分机号,Email等查询.多项查询时各项用分号隔开.</span>
  
</div><br/>
<div id="add_user">
  <%= link_to "Add an Employee",{:action=>'new'},:class=>"link_as_button" %>
  <span>总计: <%= User.count %></span>
</div>
<br/>

<div id="search_result">
    <%= render :partial => 'search_result' ,:object =>@users %>
  
</div>



